using NLog.Web;
using System;
using System.Collections.Generic;
using System.Text;

namespace Util.Helper
{
    /// <summary>
    /// 日志帮助类
    /// </summary>
    public class NLogHelper
    {
        private NLog.Logger _logger;

        public static NLogHelper NLogHelperBuilder()
        {
            return new NLogHelper();
        }

        public NLogHelper()
        {
            _logger = NLogBuilder.ConfigureNLog("Config/NLog.config")
                                 .GetCurrentClassLogger();
        }

        #region error
        public void Error(string message)
        {
            _logger.Error(message);
        }

        public void Error(string message, params object[] args)
        {
            _logger.Error(message, args);
        }

        public void Error(Exception exception,string message)
        {
            _logger.Error(exception, message);
        }

        public void Error(Exception exception, string message, params object[] args)
        {
            _logger.Error(exception, message, args);
        }

        public void Error(IFormatProvider formatProvider, string message, params object[] args)
        {
            _logger.Error(formatProvider, message, args);
        }

        public void Error(Exception exception, IFormatProvider formatProvider, string message, params object[] args)
        {
            _logger.Error(exception, formatProvider, message, args);
        }

        public void Error<T>(T value)
        {
            _logger.Error<T>(value);
        }
        #endregion

        #region info
        public void Info(string message)
        {
            _logger.Info(message);
        }

        public void Info(string message, params object[] args)
        {
            _logger.Info(message, args);
        }

        public void Info(Exception exception, string message)
        {
            _logger.Info(exception, message);
        }

        public void Info(Exception exception, string message, params object[] args)
        {
            _logger.Info(exception, message, args);
        }

        public void Info(IFormatProvider formatProvider, string message, params object[] args)
        {
            _logger.Info(formatProvider, message, args);
        }

        public void Info(Exception exception, IFormatProvider formatProvider, string message, params object[] args)
        {
            _logger.Info(exception, formatProvider, message, args);
        }

        public void Info<T>(T value)
        {
            _logger.Info<T>(value);
        }
        #endregion

        #region debug
        public void Debug(string message)
        {
            _logger.Debug(message);
        }

        public void Debug(string message, params object[] args)
        {
            _logger.Debug(message, args);
        }

        public void Debug(Exception exception, string message)
        {
            _logger.Debug(exception, message);
        }

        public void Debug(Exception exception, string message, params object[] args)
        {
            _logger.Debug(exception, message, args);
        }

        public void Debug(IFormatProvider formatProvider, string message, params object[] args)
        {
            _logger.Debug(formatProvider, message, args);
        }

        public void Debug(Exception exception, IFormatProvider formatProvider, string message, params object[] args)
        {
            _logger.Debug(exception, formatProvider, message, args);
        }

        public void Debug<T>(T value)
        {
            _logger.Debug<T>(value);
        }
        #endregion
    }
}
